#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QImage>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QTimer>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onConnectClicked();
    void onRefreshClicked();
    void updateFPS();
    void handleReadyRead();
    void handleError(QNetworkReply::NetworkError error);
    void handleFinished();

private:
    Ui::MainWindow *ui;
    QNetworkAccessManager *networkManager;
    QString cameraUrl;
    QTimer *fpsTimer;
    int frameCount;
    bool isConnected;
};

#endif // MAINWINDOW_H
